package org.burning.crm.settings.service.impl;

import org.burning.crm.settings.domain.User;
import org.burning.crm.settings.mapper.UserMapper;
import org.burning.crm.settings.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public User queryUserByLoginActAndPwd(Map<String, Object> map) {
        return userMapper.selectUserByLoginActAndPwd(map);
    }

    @Override
    public List<User> queryAllUsers() {
        return userMapper.selectAllUsers();
    }

    @Override
    public int queryUserByLoginEmail(String email) {
        return userMapper.selectUserByLoginEmail(email);
    }

    @Override
    public User queryUserByLoginPhone(String phone) {
        return userMapper.selectUserByLoginPhone(phone);
    }


    @Override
    public User getUserByEmail(String email) {
        return userMapper.getUserByEmail(email);
    }

    @Override
    public User queryUserByLoginAct(String loginAct) {
        return userMapper.selectUserByLoginAct(loginAct);
    }

    @Override
    public void addUser(User user) {
        userMapper.insertSelective(user);
    }

//    @Override
//    public void addUser(User user) {
//        userMapper.insertUser(user);
//    }

}
